package com.trmp.platform.partnership.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.trmp.platform.partnership.dao.OrgListenerInfoDao;
import com.trmp.platform.partnership.entity.OrgListenerInfo;
import com.trmp.platform.partnership.service.OrgListenerInfoService;

@Service
public class OrgListenerInfoServiceImpl implements OrgListenerInfoService
{

	@Autowired
	private OrgListenerInfoDao orgListenerInfoDao;
	
	@Override
	public void save(OrgListenerInfo orgListenerInfo)
	{
		orgListenerInfoDao.save(orgListenerInfo);
	}
	
	
	@Override
	@Transactional
	public void delete(long listenerOrgId,long orgid)
	{
		orgListenerInfoDao.deleteByOrgidAndListenerOrgId(listenerOrgId, orgid);
	}


	@Override
	@Transactional
	public List<OrgListenerInfo> getOrgByOrgId(Long orgId)
	{
		return orgListenerInfoDao.findByOrgId(orgId);
	}
	
}
